//
//  YWknowledgeViewController.m
//  maintain
//
//  Created by 郑想 on 15/10/28.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWknowledgeViewController.h"
#import "UIColor+CustomColors.h"
#import "YWMacro.h"

#define kRowHeight (70)

@interface YWknowledgeViewController ()
@property (nonatomic, strong) NSArray* sourceDatas;
@end

@implementation YWknowledgeViewController
- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = NSLocalizedString(@"knowledgeBase", nil);
    self.view.backgroundColor = [UIColor customBackgroudColor];

    self.tableView.rowHeight = kRowHeight;
    self.tableView.tableFooterView = [[UIView alloc] init];
}

#pragma mark - Init mothods
- (NSArray*)sourceDatas
{
    if (!_sourceDatas) {
        _sourceDatas = [NSArray array];
    }
    return _sourceDatas;
}

#pragma mark - UITableViewDataSource mothods
- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.sourceDatas.count;
}

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
    static NSString* identifier = @"YWknowledgeViewControllerCellIdentifier";
    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
        cell.selectionStyle = UITableViewCellSelectionStyleDefault;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.separatorInset = UIEdgeInsetsMake(0, 15, 0, 0);
        cell.detailTextLabel.textColor = [UIColor customBlueColor];
    }
    return cell;
}
@end
